From 91072e1d62f6a22686ab2b18f50bf6777ade0eec Mon Sep 17 00:00:00 2001 From: tonibm19 Date: Mon, 29 Feb 2016 11:09:21 +0100 Subject: Mobs no longer spawn at the top of the nether. I don't really know if this is the right place for the check, but it works. Add bedrock check fix typo Using code provided by NiLSpace and fixed a horse's bug -Horses can no longer be "controlled" if they're not tamed and saddled removed unrelated horse code Fixed mobs spawning above bedrock --- src/MobSpawner.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/MobSpawner.cpp b/src/MobSpawner.cpp index 8db6b8edd..60f7cfb43 100644 --- a/src/MobSpawner.cpp +++ b/src/MobSpawner.cpp @@ -134,6 +134,11 @@ bool cMobSpawner::CanSpawnHere(cChunk * a_Chunk, int a_RelX, int a_RelY, int a_R return false; } + if (cChunkDef::IsValidHeight(a_RelY - 1) && (a_Chunk->GetBlock(a_RelX, a_RelY - 1, a_RelZ) == E_BLOCK_BEDROCK)) + { + return false; // Make sure mobs do not spawn on bedrock. + } + cFastRandom Random; BLOCKTYPE TargetBlock = a_Chunk->GetBlock(a_RelX, a_RelY, a_RelZ); -- cgit v1.2.3